#include<stdio.h>

int main()
{
	int a;
	char b; 
	float c;
	
	scanf("%c%d",&b,&a);
	if(b=='C')
    c=0.50*a;
    if(b=='L')
    c=2.50*a;
    if(b=='B')
    c=1.50*a;
    if(b=='H')
    c=3.50*a;
	printf("%.1f",c);
	
	
	return 0;
}
